package cn.xm.org.domain;

import cn.xm.basic.domain.BaseDomain;
import com.fasterxml.jackson.annotation.JsonInclude;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotEmpty;
import java.util.ArrayList;
import java.util.List;

@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiOperation("部门的实体类")
public class Department extends BaseDomain {


    @NotEmpty(message = "编号不能为空")
    @ApiModelProperty("编号")
    private String sn;
    @NotEmpty(message = "姓名不能为空")
    @ApiModelProperty("姓名")
    private String name;
    // 上级部门的分类
    @ApiModelProperty("部门级别")
    private String dirPath;
    @ApiModelProperty("状态")
    private Integer state;
    // 主管者id
    @ApiModelProperty("主管id")
    private Long  managerId;
    // 主管对象
    @ApiModelProperty("主管对象")
    private Emp manager;
    // 上级部门
    @ApiModelProperty("上级部门id")
    private Long parentId;
    // 上级部门对象
    @ApiModelProperty("上级部门对象")
    private Department parent;
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private List<Department> children = new ArrayList<>(0);


}
